package com.designmodel.created.singleton;

/**
 * 懒汉式单例模式（适合多线程安全）
 *
 * @author think
 * @version 1.0.0
 */
public class Singleton4 {

    private static volatile Singleton4 singleton4 = null;

    private Singleton4() {
    }

    public static synchronized Singleton4 getInstance() {
        if (singleton4 == null) {
            singleton4 = new Singleton4();
        }
        return singleton4;
    }
}
